<div class="al-modal-view">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" ng-click="cancel()">
      <span aria-hidden="true" class="glyphicon glyphicon-remove"></span>
      <span class="sr-only">Close</span>
    </button>
    <h4 class="modal-title ok-color">{{modalTitle}}</h4>
  </div>
  <div class="modal-body">
      <ng-form name="modalForm" class="form-horizontal form-validation" role="form">

        <div class="form-group">
          <label class="col-sm-3 control-label">菜单层级</label>
          <div class="col-sm-8">
            <select ng-model="data.level" class="form-control" ng-change="chooseLevel()"
                    ng-options="option.value as option.name for option in modalMenuLvList">
            </select>
          </div>
        </div>
        <div class="form-group" ng-if="data.level>=2">
          <label class="col-sm-3 control-label">一级菜单</label>
          <div class="col-sm-8">
            <select ng-model="data.parent" class="form-control"
                    ng-options="option.value as option.name for option in subMenuList">
            </select>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-3 control-label">菜单URL<span class="attr-need">*</span></label>
          <div class="col-sm-8">
            <input class="form-control" ng-model="data.moduleUrl" type="text"
                   ng-required="true" name="moduleUrl"
                   placeholder="" maxlength="50"/>
            <div class="help-block with-errors"
                 ng-if="modalForm.moduleUrl.$invalid && !modalForm.moduleUrl.$pristine">
              菜单URL不可为空
            </div>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-3 control-label">菜单名称<span class="attr-need">*</span></label>
          <div class="col-sm-8">
            <input class="form-control" ng-model="data.moduleName" type="text"
                   ng-required="true" name="moduleName"
                   placeholder="" maxlength="50"/>
            <div class="help-block with-errors"
                 ng-if="modalForm.moduleName.$invalid && !modalForm.moduleName.$pristine">
              菜单名称不可为空
            </div>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-3 control-label">菜单图标</label>
          <div class="col-sm-8">
            <input class="form-control" ng-model="data.icon" type="text" placeholder="" maxlength="50"/>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-3 control-label">序号</label>
          <div class="col-sm-8">
            <input class="form-control" ng-model="data.sortNo" type="text" name="sortNo"
                   ng-pattern="/^[1-9]{1}[0-9]{0,4}$/" placeholder=""/>
            <div class="help-block with-errors"
                 ng-if="modalForm.sortNo.$invalid && !modalForm.sortNo.$pristine">
              序号必须为1~4位自然数
            </div>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-3 control-label">菜单类型</label>
          <div class="col-sm-8">
            <select ng-model="data.isLeaf" class="form-control"
                    ng-options="option.value as option.name for option in menuTypeList">
            </select>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-3 control-label">描述</label>
          <div class="col-sm-8">
            <input class="form-control" ng-model="data.description" placeholder="">
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-3 control-label">状态</label>
          <div class="col-sm-8">
            <nobr>
              <label class="ui-radio" ng-repeat="option in modalEnableList">
                <input name="status" ng-value="option.value" type="radio" ng-model="data.enabled">
                <span>{{option.name}}</span>
              </label>
            </nobr>
          </div>
        </div>
      </ng-form>
  </div>
  <div class="modal-footer">
    <button class="btn btn-warning no-border" type="button" ng-click="cancel()">取消</button>
    <button class="btn btn-primary no-border" type="button" ng-click="confirm()" ng-disabled="modalForm.$invalid">确定</button>
  </div>
</div>